/****** PLACE YOUR CUSTOM STYLES HERE ******/
var legal_person_data = {"uploadData":[{"count":630},{"count":986},{"count":792},{"count":642},{"count":521},{"count":573}
					,{"count":832},{"count":747},{"count":983},{"count":836},{"count":831},{"count":633}],
		"updateData":[{"count":110},{"count":181},{"count":123},{"count":197},{"count":123},{"count":173}
					,{"count":123},{"count":151},{"count":101},{"count":152},{"count":101},{"count":177}],
		"viewData":[{"count":651},{"count":842},{"count":223},{"count":223},{"count":221},{"count":812}
					,{"count":928},{"count":219},{"count":613},{"count":254},{"count":981},{"count":301}]};
var people_data = {"uploadData":[{"count":1300},{"count":1686},{"count":1692},{"count":1742},{"count":1621},{"count":773}
				,{"count":832},{"count":1047},{"count":1483},{"count":1336},{"count":831},{"count":973}],
	"updateData":[{"count":103},{"count":281},{"count":203},{"count":197},{"count":173},{"count":154}
				,{"count":223},{"count":251},{"count":201},{"count":252},{"count":201},{"count":277}],
	"viewData":[{"count":651},{"count":842},{"count":223},{"count":223},{"count":221},{"count":812}
				,{"count":928},{"count":219},{"count":613},{"count":254},{"count":981},{"count":301}]};
var picture_data = {"uploadData":[{"count":330},{"count":786},{"count":492},{"count":842},{"count":421},{"count":673}
				,{"count":932},{"count":447},{"count":583},{"count":436},{"count":331},{"count":433}],
	"updateData":[{"count":10},{"count":81},{"count":23},{"count":97},{"count":23},{"count":73}
				,{"count":23},{"count":51},{"count":01},{"count":52},{"count":01},{"count":77}],
	"viewData":[{"count":451},{"count":342},{"count":523},{"count":323},{"count":421},{"count":812}
				,{"count":728},{"count":619},{"count":613},{"count":554},{"count":481},{"count":301}]};
			
var Tpl1 = '<li>' +
			'<p class="data-count">5681</p>' +
			'<span class="data-name">数据总量</span>' +
			'</li>' +
			'<li>' +
			'<p class="data-count">1331</p>' +
			'<span class="data-name">更新量</span>' +
			'</li>' +
			'<li>' +
			'<p class="data-count">3753</p>' +
			'<span class="data-name">共享次数</span>' +
			'</li>' ;		
var Tpl2 = '<li>' +
			'<p class="data-count">3971</p>' +
			'<span class="data-name">数据总量</span>' +
			'</li>' +
			'<li>' +
			'<p class="data-count">1141</p>' +
			'<span class="data-name">更新量</span>' +
			'</li>' +
			'<li>' +
			'<p class="data-count">3753</p>' +
			'<span class="data-name">共享次数</span>' +
			'</li>' ;
var Tpl3 = '<li>' +
			'<p class="data-count">4742</p>' +
			'<span class="data-name">数据总量</span>' +
			'</li>' +
			'<li>' +
			'<p class="data-count">1231</p>' +
			'<span class="data-name">更新量</span>' +
			'</li>' +
			'<li>' +
			'<p class="data-count">2983</p>' +
			'<span class="data-name">共享次数</span>' +
			'</li>' ;		
$('.com-screen-content .use-data').html(Tpl1);			
// 基于准备好的dom，初始化echarts实例
var myChart1= echarts.init(document.getElementById('main1'));
var myChart2 = echarts.init(document.getElementById('main2'));
var myChart3 = echarts.init(document.getElementById('main3'));
//var myChart4 = echarts.init(document.getElementById('main4'));
var myChart5 = echarts.init(document.getElementById('main5'));
var myChart6 = echarts.init(document.getElementById('main6'));
var myChart7 = echarts.init(document.getElementById('main7'));

var wid = 0;
var arrw = [];
(function() {
	$.ajax({
		type: 'post',
		data: {},
		url: "/panelWms/findWarehouse",
		dataType:"json",
	    async: false,
		success: function (data) {
	        if(data.data.length>0){
				arrw = data.data
	        	var str = "";
	        	$.each(data.data,function(key,value){
	        		str += "<option value='"+value.id+"'>"+value.warehouseName+"</option>";
	        	});
	        	$("#select").html(str);
	        	
				  var datad = new Date();
				  //获取年
				  var year = datad.getFullYear();
				  //获取月
				  var mon = datad.getMonth() + 1;
				  var arry = new Array();
				  var html = ""
				  for (var i = 0; i < 12; i++) {
					if (mon <= 0) {
					  year = year - 1;
					  mon = mon + 12;
					}
					if (mon < 10) {
					  mon = "0" + mon;
					}
					arry[i] = year + "-" + mon;
					html += "<option value='"+year + "-" + mon+"'>"+year + "-" + mon+"</option>";
					mon = mon - 1;
				  }
				  $("#select1").html(html);

				var obj = document.getElementById("select");
			    var sele = obj.options;
				var index = obj.selectedIndex;
				wid = sele[index].value
				
				var obj1 = document.getElementById("select1");
			    var sele1 = obj1.options;
				var index1 = obj1.selectedIndex;
				
				sum();
				init_myChart1();
				init_myChart2();
				init_myChart3(legal_person_data);
				init_myChart5();
				init_myChart6(sele1[index1].value);
				init_myChart7(sele1[index1].value);
				
			    obj.onchange = function(){
					var index = obj.selectedIndex;
					wid = sele[index].value
					
					var index1 = obj1.selectedIndex;
				
					sum();
					init_myChart1();
					init_myChart2();
					init_myChart3(legal_person_data);
					init_myChart5();
					init_myChart6(sele1[index1].value);
					init_myChart7(sele1[index1].value);
			    } 
			    obj1.onchange = function(){
					var index = obj.selectedIndex;
					wid = sele[index].value
					
					var index1 = obj1.selectedIndex;
				
					sum();
					init_myChart1();
					init_myChart2();
					init_myChart3(legal_person_data);
					init_myChart5();
					init_myChart6(sele1[index1].value);
					init_myChart7(sele1[index1].value);
			    } 
	        }
		}
	});
})();

function sum(){
	$.each(arrw,function(key,value){
		if(value.id == wid){
			$.ajax({
				  url: "https://devapi.qweather.com/v7/weather/now",
				  type: "GET",
				  dataType: 'json',	
				  data: {key:'08b7511820264d81acd325c1a4c945df',location:Number(value.longitude.toString().match(/^\d+(?:\.\d{0,2})?/))+','+Number(value.latitude.toString().match(/^\d+(?:\.\d{0,2})?/))}, //(returnCitySN.cname).split('省')[1]：获取所在的市
				  success: function (res) {
						$("#wendu").text(res.now.temp+'℃')
						$("#shidu").text(res.now.humidity+'%')
				  },
				  error: function (err) {
						console.log(err)
				  }
			});
		}
	});

	$.ajax({
		type: 'post',
		data: {warehouseId:wid},
		url: "/panelWms/sumGoodsZongliang",
		dataType:"json",
		success: function (data) {
			var list = data.data
			if(list != null && list != ""){
				$("#zongshuliang").text(list.num)
				$("#zongfangshu").text(list.stockVolume)
				/*$("#zonghuozhi").text(list.stockMoney)*/
			} else {
				$("#zongshuliang").text(0)
				$("#zongfangshu").text(0)
				$("#zonghuozhi").text(0)
			}
		}
	});
	
	$.ajax({
		type: 'post',
		data: {warehouseId:wid},
		url: "/panelWms/wmsData",
		dataType:"json",
		success: function (data) {
			var list = data.data
			if(list.length > 0){
				var html = "<ul>"
				for (var i = 0; i < list.length ; i++) {
					html += '<li>'+
									'<div>'+list[i].storageGoodsname+'</div>'+
									'<div>'+list[i].storageOutStatus+'</div>'+
									'<div>'+list[i].realNum+'件</div>'+
									'<div>'+list[i].updateTime.substring(6,16)+'</div>'+
								'</li> '
				}
				html += "</ul>"
				$("#liudong").html(html)
			} else {
				$("#liudong").html("")
			}
		}
	});
}

function init_myChart3(data) {
	var xData = ['已过1/3','已过1/2','剩余一个月以内','已过期'];
	$.ajax({
		type: 'post',
		data: {warehouseId:wid},
		url: "/panelWms/baozhiqiCount",
		dataType:"json",
		success: function (data) {
			var list = data.data
			var yData = [];
			if(list != null && list != ""){
				yData.push(list.mark)
				yData.push(list.operateName)
				yData.push(list.customerName)
				yData.push(list.warehouseName)
			} else {
				yData.push(0)
				yData.push(0)
				yData.push(0)
				yData.push(0)
			}
			option = {
				toolbox: {
					show : true,
					feature : {
						mark : {show: true},
						dataView: {show: true, readOnly: false},
						restore: {show: true},
						saveAsImage: {show: true}
					}
				},
				grid: {
				   "borderWidth": 0,
						"top": '40',
						"left": '10%',
						"right": '10',
						"bottom": '40',
						textStyle: {
							color: "#fff"
						}
				},
		        xAxis: [{
		            type: "category",
					data: xData,
		            axisTick: {
		                alignWithLabel: true
		            },
		            // 修改刻度标签 相关样式
		            axisLabel: {
		                color: "rgba(255,255,255,.6) ",
		                fontSize: "13"
		            },
		            // 不显示x坐标轴的样式
		            axisLine: {
		                show: false
		            }
		        }],
		        yAxis: [{
		            type: "value",
		            // 修改刻度标签 相关样式
		            axisLabel: {
		                color: "rgba(255,255,255,.6) ",
		                fontSize: 13
		            },
		            // y轴的线条改为了 2像素
		            axisLine: {
		                lineStyle: {
		                    color: "rgba(255,255,255,.1)",
		                    width: 2
		                }
		            },
		            // y轴分割线的颜色
		            splitLine: {
		                lineStyle: {
		                    color: "rgba(255,255,255,.1)"
		                }
		            }
		        }],
				"tooltip": {
					"trigger": "axis",
					axisPointer: {
						type: 'shadow',
					}
				},
				series : [
					{
						name:'货品总量',
						type:'bar',
						data:yData,
						itemStyle: {
							normal: {
								color: function(params) {
									var colorList = ['#5470c7','#97d579','#fbd05b','#f26868','#73c0de','#3ca674','#fc8854','#9a60b4']
									return colorList[params.dataIndex]
								},
							   	barBorderRadius: 10,
							}
						},
						 barWidth: 30,
						 label: {
								normal: {
									show: true,
									position: "top",
									textStyle: {
										color: "#ffc72b",
										fontSize: 10
									}
								}
							},
					}
				]
			};
			myChart3.setOption(option);
			tools.loopShowTooltip(myChart3, option, {
			    loopSeries: true,
				interval:4000
			});
		}
	});
}

function init_myChart2() {
	$.ajax({
		type: 'post',
		data: {warehouseId:wid},
		url: "/panelWms/monthPutOutCount",
		dataType:"json",
		success: function (data) {
			var list = data.data
			var arr1 = []
			var arr2 = []
			var arr3 = []
			for (var i = 0; i < list.length ; i++) {
				arr1.push(list[i].mark.substring(5,7)+'月')
				var obj1 = {}
				obj1.count = list[i].num
				arr2.push(obj1)
				var obj2 = {}
				obj2.count = list[i].balenum
				arr3.push(obj2)
			}
			var data = {"uploadData":arr2,
						"viewData":arr3};
			var uploadCnt = [];
		
			var viewCnt = [];
			if (data.uploadData != null) {
				for (var i = 0; i < data.uploadData.length; i++) {
					uploadCnt.push(data.uploadData[i].count);
				}
			}
		
			if (data.viewData != null) {
				for (var i = 0; i < data.viewData.length; i++) {
					viewCnt.push(data.viewData[i].count);
				}
			}
			option = {
				toolbox: {
					show: true,
					feature: {
						mark: {show: true},
						dataView: {show: true, readOnly: false},
						restore: {show: true},
						saveAsImage: {show: true}
					}
				},
				tooltip: {
					trigger: 'axis',
					formatter: function (params, ticket, callback) {
						var res = '';
						for (var i = 0, l = params.length; i < l; i++) {
							res += '' + params[i].seriesName + ' : ' + params[i].value + '<br>';
						}
						return res;
					},
					transitionDuration: 0,
					backgroundColor: 'rgba(83,93,105,0.8)',
					borderColor: '#535b69',
					borderRadius: 8,
					borderWidth: 2,
					padding: [5, 10],
					axisPointer: {
						type: 'line',
						lineStyle: {
							type: 'dashed',
							color: '#ffff00'
						}
					}
				},
				legend: {
					icon: 'circle',
					itemWidth: 8,
					itemHeight: 8,
					itemGap: 10,
					top: '16',
					right: '10',
					textStyle: {
						fontSize: 14,
						color: '#a0a8b9'
					}
				},
				grid: {
					top:'20%',
					left: '10%',
					right: '3%',
					//bottom: '10%',
					containLabel: false
				},
				xAxis: [{
					type: 'category',
					boundaryGap: false,
					axisLabel: {
						interval: 0,
						fontSize:14
					},
					axisLine: {
						show: false,
						lineStyle: {
							color: '#a0a8b9'
						}
					},
					axisTick: {
						show: false
					},
					data: arr1,
					offset: 10
				}],
				yAxis: [{
					type: 'value',
					axisLine: {
						show: false,
						lineStyle: {
							color: '#a0a8b9'
						}
					},
					axisLabel: {
						margin: 10,
						textStyle: {
							fontSize: 14
						}
					},
					splitLine: {
						lineStyle: {
							color: '#2b3646'
						}
					},
					axisTick: {
						show: false
					}
				}],
				series: [{
					name: '入库总量',
					type: 'line',
					smooth: true,
					showSymbol: false,
					lineStyle: {
						normal: {
							width: 2
						}
					},
					areaStyle: {
						normal: {
							color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
								offset: 0,
								color: 'rgba(137, 189, 27, 0.3)'
							}, {
								offset: 0.8,
								color: 'rgba(137, 189, 27, 0)'
							}], false),
							shadowColor: 'rgba(0, 0, 0, 0.1)',
							shadowBlur: 10
						}
					},
					itemStyle: {
						normal: {
							color: '#1cc840'
						}
					},
					data: uploadCnt
				}, {
					name: '出库总量',
					type: 'line',
					smooth: true,
					showSymbol: false,
					lineStyle: {
						normal: {
							width: 2
						}
					},
					areaStyle: {
						normal: {
							color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
								offset: 0,
								color: 'rgba(219, 50, 51, 0.3)'
							}, {
								offset: 0.8,
								color: 'rgba(219, 50, 51, 0)'
							}], false),
							shadowColor: 'rgba(0, 0, 0, 0.1)',
							shadowBlur: 10
						}
					},
					itemStyle: {
						normal: {
							color: '#eb5690'
						}
					},
					data: viewCnt
				}
				]
			};
			myChart2.setOption(option);
			tools.loopShowTooltip(myChart2, option, {
			    loopSeries: true,
				interval:4000
			});
		}
	});
}

function init_myChart1(){
	$.ajax({
		type: 'post',
		data: {warehouseId:wid},
		url: "/panelWms/sumGoods",
		dataType:"json",
		success: function (data) {
			var list = data.data
			var arr1 = []
			for (var i = 0; i < list.length ; i++) {
				var obj = {}
				obj.value = list[i].num
				if(list[i].goodsBigtype == "" || list[i].goodsBigtype == null){
					obj.name = "其他"
				} else {
					obj.name = list[i].goodsBigtype
				}
				arr1.push(obj)
			}
			option = {
				tooltip : {
					trigger: 'item',
					formatter: "{a} <br/>{b} : {c}件({d}%)"
				},
				toolbox: {
					show: true,
					feature: {
						mark: {show: true},
						dataView: {show: true, readOnly: false},
						restore: {show: true},
						saveAsImage: {show: true}
					}
				},
				color:['#5470c7','#97d579','#fbd05b','#f26868','#73c0de','#3ca674','#fc8854','#9a60b4'],
			   
				series : [
					{
						name: '货品总量',
						type: 'pie',
						radius : '55%',
						center: ['50%', '60%'],
						data:arr1,
						itemStyle: {
							emphasis: {
								shadowBlur: 10,
								shadowOffsetX: 0,
								shadowColor: 'rgba(0, 0, 0, 0.5)'
							}
						},
						itemStyle: {
							normal: {
								label:{ 
									show: true, 
									formatter: '{b}：\n{c} ({d}%)' ,
									fontSize : 12,    //文字的字体大小
								}
							},
							labelLine :{show:true}
						}
					}
				]
			};
			// 使用刚指定的配置项和数据显示图表。
			myChart1.setOption(option);
		}
	});
}

function init_myChart5(){
	var XData=["今日已完成","今日新订单","未完成","逾期","今日已取消"];
	$.ajax({
		type: 'post',
		data: {warehouseId:wid},
		url: "/panelWms/outOrderCount",
		dataType:"json",
		success: function (data) {
			var list = data.data
			var yData=[];
			yData.push(list.outOrderStatus)
			yData.push(list.outOrderNumber)
			yData.push(list.outCustomerName)
			yData.push(list.customerNumber)
			yData.push(list.saleDeliveryCompany)
			option = {
				toolbox: {
					show: true,
					feature: {
						mark: {show: true},
						dataView: {show: true, readOnly: false},
						restore: {show: true},
						saveAsImage: {show: true}
					}
				},
				backgroundColor:"",
		        xAxis: [{
		            type: "category",
					data: XData,
		            axisTick: {
		                alignWithLabel: true
		            },
		            // 修改刻度标签 相关样式
		            axisLabel: {
		                color: "rgba(255,255,255,.6) ",
		                fontSize: "13"
		            },
		            // 不显示x坐标轴的样式
		            axisLine: {
		                show: false
		            }
		        }],
		        yAxis: [{
		            type: "value",
		            // 修改刻度标签 相关样式
		            axisLabel: {
		                color: "rgba(255,255,255,.6) ",
		                fontSize: 13
		            },
		            // y轴的线条改为了 2像素
		            axisLine: {
		                lineStyle: {
		                    color: "rgba(255,255,255,.1)",
		                    width: 2
		                }
		            },
		            // y轴分割线的颜色
		            splitLine: {
		                lineStyle: {
		                    color: "rgba(255,255,255,.1)"
		                }
		            }
		        }],
				"tooltip": {
					"trigger": "axis",
					axisPointer: {
						type: 'shadow',
					}
				},
				series: [{
					name:'订单总量',
					type:"bar",
					itemStyle: {
						normal: {
							color: {
								type: 'linear',
								x: 0,
								y: 0,
								x2: 0,
								y2: 1,
								colorStops: [{
									offset: 0,
									color: '#00d386' // 0% 处的颜色
								}, {
									offset: 1,
									color: '#0076fc' // 100% 处的颜色
								}],
								globalCoord: false // 缺省为 false
							},
							barBorderRadius: 10,
						}
					},
					 label: {
							normal: {
								show: true,
								position: "top",
								textStyle: {
									color: "#ffc72b",
									fontSize: 10
								}
							}
						},
					data: yData,
					barWidth: 30,
				}]
			};
			myChart5.setOption(option);
			tools.loopShowTooltip(myChart5, option, {
			    loopSeries: true,
				interval:4000
			});
		}
	})
}

function init_myChart6(month){
	$.ajax({
		type: 'post',
		data: {warehouseId:wid,month:month},
		url: "/panelWms/appMonthJianxuanCount",
		dataType:"json",
		success: function (data) {
			var list = data.data
			var arr1 = []
			for (var i = 0; i < list.length ; i++) {
				var obj1 = {}
				obj1.count = list[i].realNum
				obj1.fang = list[i].storageVolume
				obj1.areaName = list[i].storageOutName
				arr1.push(obj1)
			}
			var data = {"uploadData":arr1};
			var uploadCnt = [];
			var viewCnt = [];
			var areaNameS = [];
			if (data.uploadData) {
				for (var i = 0; i < data.uploadData.length; i++) {
					uploadCnt.push(data.uploadData[i].count);
					areaNameS.push(data.uploadData[i].areaName);
					viewCnt.push(data.uploadData[i].fang)
				}
			}
			option = {
				toolbox: {
					show: true,
					feature: {
						mark: {show: true},
						dataView: {show: true, readOnly: false},
						restore: {show: true},
						saveAsImage: {show: true}
					}
				},
				"grid": {
					"top": '40',
					"left": '7%',
					"right": '10',
					"bottom": '40',
			
					textStyle: {
						color: "#fff"
					}
				},
				"legend": {
					right: '24',
					top: "24",
					itemWidth: 8,
					itemHeight: 12,
					textStyle: {
						color: '#fff',
						fontSize:14
					},
				},
				"calculable": true,
		        xAxis: [{
		            type: "category",
					data: areaNameS,
		            axisTick: {
		                alignWithLabel: true
		            },
		            // 修改刻度标签 相关样式
		            axisLabel: {
		                color: "rgba(255,255,255,.6) ",
		                fontSize: "13"
		            },
		            // 不显示x坐标轴的样式
		            axisLine: {
		                show: false
		            }
		        }],
		        yAxis: [{
		            type: "value",
		            // 修改刻度标签 相关样式
		            axisLabel: {
		                color: "rgba(255,255,255,.6) ",
		                fontSize: 13
		            },
		            // y轴的线条改为了 2像素
		            axisLine: {
		                lineStyle: {
		                    color: "rgba(255,255,255,.1)",
		                    width: 2
		                }
		            },
		            // y轴分割线的颜色
		            splitLine: {
		                lineStyle: {
		                    color: "rgba(255,255,255,.1)"
		                }
		            }
		        }],
				"tooltip": {
					"trigger": "axis",
					axisPointer: {
						type: 'shadow',
					}
				},
				"series": [
					{
						"name": "月作业总量",
						"type": "bar",
						"barGap": "10%",
						itemStyle: {//图形样式
							normal: {
								"color": '#5470c7',
								barBorderRadius: 10,
							}
						},
						label: {
							normal: {
								show: true,
								position: "top",
								textStyle: {
									color: "#ffc72b",
									fontSize: 10
								}
							}
						},
						"data": uploadCnt,
						barWidth: 20,
					},
					{
						"name": "月作业方数",
						"type": "bar",
						"barGap": "10%",
						itemStyle: {//图形样式
							normal: {
								"color": '#00d386',
								barBorderRadius: 10,
							}
						},
						label: {
							normal: {
								show: true,
								position: "top",
								textStyle: {
									color: "#ffc72b",
									fontSize: 10
								}
							}
						},
						"data": viewCnt,
						barWidth: 20,
					}
				]
			};
			//使用刚指定的配置项和数据显示图表。
			myChart6.setOption(option);
			// 调用本工具接口
			tools.loopShowTooltip(myChart6, option, {
			    loopSeries: true,
				interval:4000
			});
		}
	})
}

function init_myChart7(month){
	var colorList = [
	    '#5470c7'
	];
	$.ajax({
		type: 'post',
		data: {warehouseId:wid,month:month},
		url: "/panelWms/monthOutGoodsCount",
		dataType:"json",
		success: function (data) {
			var list = data.data
			var xData = []
			var yData = []
			for (var i = 0; i < list.length ; i++) {
				yData.push(list[i].realNum)
				xData.push(list[i].storageGoodsname)
			}
			option = {
			    color:colorList,
			    toolbox: {
			        show : true,
			        feature : {
			            mark : {show: true},
						dataView: {show: true, readOnly: false},
						restore: {show: true},
						saveAsImage: {show: true}
			        }
			    },
			    grid: {
			       "borderWidth": 0,
						"top": '40',
						"left": '10%',
						"right": '10',
						"bottom": '40',
						textStyle: {
							color: "#fff"
						}
			    },
			        xAxis: [{
			            type: "category",
						data: xData,
			            axisTick: {
			                alignWithLabel: true
			            },
			            // 修改刻度标签 相关样式
			            axisLabel: {
			                show: false
			            },
			            // 不显示x坐标轴的样式
			            axisLine: {
			                show: false
			            }
			        }],
			        yAxis: [{
			            type: "value",
			            // 修改刻度标签 相关样式
			            axisLabel: {
			                color: "rgba(255,255,255,.6) ",
			                fontSize: 13
			            },
			            // y轴的线条改为了 2像素
			            axisLine: {
			                lineStyle: {
			                    color: "rgba(255,255,255,.1)",
			                    width: 2
			                }
			            },
			            // y轴分割线的颜色
			            splitLine: {
			                lineStyle: {
			                    color: "rgba(255,255,255,.1)"
			                }
			            }
			        }],
					"tooltip": {
						"trigger": "axis",
						axisPointer: {
							type: 'shadow',
						}
					},
			    series : [
			        {
			            name:'出库总量',
			            type:'bar',
			            data:yData,
			            itemStyle: {
			                normal: {
								barBorderRadius: 10,
			                }
			            },
						 barWidth: 18,
						 label: {
								normal: {
									show: true,
									position: "top",
									textStyle: {
										color: "#ffc72b",
										fontSize: 10
									}
								}
							},
			        }
			     
			    ]
			};
			// 使用刚指定的配置项和数据显示图表。
			myChart7.setOption(option);
			// 调用本工具接口
			tools.loopShowTooltip(myChart7, option, {
			    loopSeries: true,
				interval:4000
			});
		}
	});
}

var resourceDataType = $('.data-label li.active').data('type');//用于切换基础库
function urlType() {
    resourceDataType = $('.data-label li.active').data('type');
    if (resourceDataType == 1) {
        init_myChart3(legal_person_data);
		$('.com-screen-content .use-data').html(Tpl1);
    } else if (resourceDataType == 2) {
        init_myChart3(people_data);
		$('.com-screen-content .use-data').html(Tpl2);
    } else if (resourceDataType == 3) {
        init_myChart3( picture_data);
		$('.com-screen-content .use-data').html(Tpl3);
    }
}
var num =0 ;
//    资源类型定时器
function resourceType() {
    $('.data-label li').eq(num).addClass('active').siblings().removeClass('active');
    //$('.active-data-label').html($('.canvas-pic-two .data-label li.active').html());
    urlType();
    num++;
    if (num >= 3) {
        num = 0;
    }
}

//    资源类型点击切换
$('.data-label').on('click', 'li', function () {
    $(this).addClass('active').siblings().removeClass('active');
    $('.active-data-label').html($('.data-label li.active').html());
    urlType();
});
var oTimer = setInterval(resourceType, 3000);
//    hover清除定时器
$('.data-label').hover(function () {
    clearInterval(oTimer);
}, function () {
    oTimer = setInterval(resourceType, 3000);
});

/*function resize(){
	window.addEventListener("resize", () => { 
  	this.myChart1.resize;
	this.myChart2.resize;
	this.myChart3.resize;
	this.myChart5.resize;
	this.myChart6.resize;
	this.myChart7.resize;
});
}*/

setInterval(function (){
    window.onresize = function () {
		this.myChart1.resize;
		this.myChart2.resize;
		this.myChart3.resize;
		this.myChart5.resize;
		this.myChart6.resize;
		this.myChart7.resize;
    }
},200)

//myChart7.resize();
